import socket
import sys
#msg = ''.join(sys.argv[1:])
# msg = 'speed|133|oil_temperature|22|water_temperature|45|oil_pressure|32|others|1012210291|' 
msg = '0x7e 0x30 0x7d 0x02 0x08 0x7d 0x01 0x55 0x7e'
address = ('localhost', 9200)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(address)
print('Sending %s bytes to %s:%s'%((len(msg),)+address))
s.send(msg.encode())
data = s.recv(1024)
print data
s.close()
